package models

import (
	"gorm.io/gorm"
	"time"
)

type TransactionDetail struct {
	RequestID      uint      `gorm:"primary_key; not null;index"` // 请求标识
	PublisherID    uint      `gorm:"not null;index"`              // 发布用户标识
	ResponderID    uint      `gorm:"not null;index"`              // 响应用户标识
	CompletionDate time.Time `gorm:"not null"`                    // 达成日期
	PublisherFee   float64   `gorm:"not null"`                    // 发布者支付中介费
	ResponderFee   float64   `gorm:"not null"`                    // 响应者支付中介费
}

func (t *TransactionDetail) CreateTransaction(tx *gorm.DB) error {
	return tx.Create(t).Error
}
